const daoCommon = require('../util/daoCommon');

const dao = {
    handleGetInformation: (data) => {
        let sql;
        if (!data) {
            sql = "select corporation_id as id,corporation_name as name,corporation_address as address";
            sql += ",corporation_contact as contact,corporation_phone as phone,corporation_wechat as weChat";
            sql += " from corporation";
        }
        return daoCommon.selectCommon(sql);
    },
    handleEditInformation: (data) => {
        let sql = "Update corporation set corporation_name=$name,corporation_address=$address,corporation_contact=$contact";
        sql += ",corporation_phone=$phone,corporation_wechat=$wechat where corporation_id='1111'";
        return daoCommon.queryCommon(sql, data);
    }
};
module.exports = dao;